#ifndef ALGORITHMSTATS_HPP
#define ALGORITHMSTATS_HPP

#include "GraphHandler.hpp"

/*
  This class records which partial we should do perdiction upon
  */
class TestingSet
{
private:
    // This records how many partial graphs of a given size there is in this TestingSet
    vector<int> m_PGSizes;

    // Graph ID and the partial graph
    vector< pair<unsigned int, GraphHandler::Graph> > m_PGs;



public:

    template<class Archive>
    void serialize(Archive &ar, const unsigned int version)
    {
        ar & m_PGSizes;
        ar & m_PGs;
    }

    void Save(string sFilename) const;
    void Load(string sFilename);

    // After running a test, these vectors are filled with IDs of the partial graphs which failed/succeeded in predictions
    vector<int> iFailedIDs;
    vector<int> iSuccIDs;

    pair<unsigned int, GraphHandler::Graph> GetPGData(int iID) { return m_PGs[iID]; }

    friend class AlgorithmStats;
    friend class GraphExploration;
};

/*
  This class is used for collecting statistics about the prediction performance of the
  different prediction algorithms.
  */
class AlgorithmStats
{

public:

    // This function generates a TestingSet upon which we will perform the predictions
    // PGSizes records how many partial graphs of a given size there is in this TestingSet
    // For example, we might demand that we want 100 PGs of size 2, 50 of size 3, and 0 otherwise.
    // That is, PGSizes[2] = 100; PGSizes[3] = 50;
    TestingSet GenerateTestingSet(vector<int> PGSizes);

    double TestAll(TestingSet& kT, bool bBForce, string sFilename);
    int TestAllGED(TestingSet kT, bool bBForce);

};

#endif // ALGORITHMSTATS_HPP
